package com.zhentao.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import lombok.Data;

/**
 * 车辆型号表
 * @TableName car_model
 */
@TableName(value ="car_model")
@Data
public class CarModel implements Serializable {
    /**
     * 型号ID
     */
    @TableId(type = IdType.AUTO)
    private Long id;

    /**
     * 品牌ID
     */
    private Long brandId;

    /**
     * 型号名称
     */
    private String modelName;

    /**
     * 型号代码
     */
    private String modelCode;

    /**
     * 车型类别
     */
    private String category;

    /**
     * 车身类型
     */
    private String bodyType;

    /**
     * 价格范围最小值(万元)
     */
    private BigDecimal priceRangeMin;

    /**
     * 价格范围最大值(万元)
     */
    private BigDecimal priceRangeMax;

    /**
     * 热度指数
     */
    private Integer popularity;

    /**
     * 状态(0:禁用,1:启用)
     */
    private Integer status;

    /**
     * 创建时间
     */
    private Date createTime;

    /**
     * 更新时间
     */
    private Date updateTime;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        CarModel other = (CarModel) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getBrandId() == null ? other.getBrandId() == null : this.getBrandId().equals(other.getBrandId()))
            && (this.getModelName() == null ? other.getModelName() == null : this.getModelName().equals(other.getModelName()))
            && (this.getModelCode() == null ? other.getModelCode() == null : this.getModelCode().equals(other.getModelCode()))
            && (this.getCategory() == null ? other.getCategory() == null : this.getCategory().equals(other.getCategory()))
            && (this.getBodyType() == null ? other.getBodyType() == null : this.getBodyType().equals(other.getBodyType()))
            && (this.getPriceRangeMin() == null ? other.getPriceRangeMin() == null : this.getPriceRangeMin().equals(other.getPriceRangeMin()))
            && (this.getPriceRangeMax() == null ? other.getPriceRangeMax() == null : this.getPriceRangeMax().equals(other.getPriceRangeMax()))
            && (this.getPopularity() == null ? other.getPopularity() == null : this.getPopularity().equals(other.getPopularity()))
            && (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus()))
            && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()))
            && (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getBrandId() == null) ? 0 : getBrandId().hashCode());
        result = prime * result + ((getModelName() == null) ? 0 : getModelName().hashCode());
        result = prime * result + ((getModelCode() == null) ? 0 : getModelCode().hashCode());
        result = prime * result + ((getCategory() == null) ? 0 : getCategory().hashCode());
        result = prime * result + ((getBodyType() == null) ? 0 : getBodyType().hashCode());
        result = prime * result + ((getPriceRangeMin() == null) ? 0 : getPriceRangeMin().hashCode());
        result = prime * result + ((getPriceRangeMax() == null) ? 0 : getPriceRangeMax().hashCode());
        result = prime * result + ((getPopularity() == null) ? 0 : getPopularity().hashCode());
        result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode());
        result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
        result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", brandId=").append(brandId);
        sb.append(", modelName=").append(modelName);
        sb.append(", modelCode=").append(modelCode);
        sb.append(", category=").append(category);
        sb.append(", bodyType=").append(bodyType);
        sb.append(", priceRangeMin=").append(priceRangeMin);
        sb.append(", priceRangeMax=").append(priceRangeMax);
        sb.append(", popularity=").append(popularity);
        sb.append(", status=").append(status);
        sb.append(", createTime=").append(createTime);
        sb.append(", updateTime=").append(updateTime);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}